<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__ROOT__/layui/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="__ROOT__/layui/lib/jq-module/zyupload/zyupload-1.0.0.min.css" media="all">
    <link rel="stylesheet" href="__ROOT__/layui/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">

    <div class="layui-form-item">
        <label class="layui-form-label required">项目名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required" lay-reqtext="不能为空" placeholder="请输入项目名称" value="" class="layui-input">
            <tip>填写项目名称。</tip>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">编程语言</label>
        <div class="layui-input-block">
            <input type="text" name="language" lay-verify="required" lay-reqtext="不能为空" placeholder="请输入编程语言" value="" class="layui-input">
            <tip>填写该项目的编程语言。</tip>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">实现平台</label>
        <div class="layui-input-block">
            <input type="text" name="platform" lay-verify="required" lay-reqtext="不能为空" placeholder="请输入项目名称" value="" class="layui-input">
            <tip>填写自己管理的项目名称。</tip>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">应用行业</label>
        <div class="layui-input-block">
            <input type="text" name="industry" lay-verify="required" lay-reqtext="不能为空" placeholder="请输入项目名称" value="" class="layui-input">
            <tip>填写自己管理的项目名称。</tip>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">技术领域</label>
        <div class="layui-input-block">
            <input type="text" name="field" lay-verify="required" lay-reqtext="不能为空" placeholder="请输入项目名称" value="" class="layui-input">
            <tip>填写自己管理的项目名称。</tip>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">项目简介</label>
        <div class="layui-input-block">
            <textarea name="content" class="layui-textarea" placeholder="请输入项目简介"></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">要实现的内容</label>
        <div class="layui-input-block">
            <textarea name="deliver" class="layui-textarea" placeholder="请输入项目简介"></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="beizhu" class="layui-textarea" placeholder="请输入备注"></textarea>
        </div>
    </div>


    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>
</div>
<script src="__ROOT__/layui/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="__ROOT__/layui/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="__ROOT__/layui/lib/jq-module/zyupload/zyupload-1.0.0.min.js" charset="utf-8"></script>
<script>
    layui.use(['upload','form'], function () {
        var form = layui.form,
            layer = layui.layer,
            upload = layui.upload,
            $ = layui.$;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            var url = "{:url('order/up_add')}";
            var data=(data.field);
            var success = "{:url('order/check')}";
            //    执行异步请求 ，$.post
            $.post(url,data,function(result){
                if(result.status ==0){
                    layer.open({
                        content:result.message,
                        icon:2,
                        title : '错误提示'
                    });

                }
                if(result.status ==1){
                    layer.open({
                        content : result.message,
                        icon : 1,
                        yes : function(){
                            // location.href=success;
                            setTimeout(function () {
                                window.parent.location.reload(); //刷新父页面
                                var index = parent.layer.getFrameIndex(window.name)
                                parent.layer.close(index);
                            }, 500);
                        }
                    });

                }

            },'JSON');
            return false;

        });



    });
</script>
<script type="text/javascript">

</script>
</body>
</html>